import numpy as np
import tensorflow as tf
import readdata as rd
from alexnet import AlexNet
import new.alexnet as nn

# Learning params
learning_rate = 0.01
num_epochs = 10
batch_size = 128

# Network params
dropout_rate = 0.5
num_classes = 2
train_layers = ['fc8', 'fc7', 'fc6']
keep_prob = tf.placeholder(tf.float32)

# you need to change the directories to yours.
#    train_dir = '/home/hjxu/PycharmProjects/01_cats_vs_dogs/data/train/'
logs_train_dir = 'logs\\recordstrain\\'
#
#    train, train_label = input_data.get_files(train_dir)
# 第一步获取数据，batch和lable
tfrecords_file = 'catvsdogtrain.tfrecords'
train_batch, train_label_batch = rd.read_and_decode(tfrecords_file, batch_size=batch_size)
train_batch = tf.cast(train_batch, dtype=tf.float32)
train_label_batch = tf.cast(train_label_batch, dtype=tf.int64)
# TF placeholder for graph input and output
x = tf.placeholder(tf.float32, [batch_size, 227, 227, 3])
y = tf.placeholder(tf.float32, [batch_size, num_classes])
model = AlexNet(x, keep_prob, num_classes, train_layers)
